<?php
/**
* Copyright 2009 Waag Society <http://www.waag.org>
* This file is part of Annotrax.
*
* Annotrax is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* Annotrax is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Annotrax.
* If not, see http://www.gnu.org/licenses/gpl.html
*/

/**
 * this is the main theme-layout for
 * Annotrax.
 */
?>
<?php echo $this->doctype(); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<?php echo $this->headTitle( $this->pageTitle ) ?>
<?php
	//$title = isset($this->pageTitle) ? '- ' . strip_tags($this->pageTitle) : '';
	//echo $this->headTitle( sprintf( '%s %s', 'Annotrax', $title ));
	?>
    <link rel="shortcut icon" href="<?php echo $this->themeUrl() ?>favicon.ico">
	<script>
	var themeUrl = '<?php echo $this->themeUrl() ?>';
	</script>
	<link type="text/css" rel="stylesheet" media="all" href="<?php echo $this->themeUrl() ?>css/style.css" />
	<link type="text/css" rel="stylesheet" media="all" href="<?php echo $this->themeUrl() ?>css/layout.css" />
	<link type="text/css" rel="stylesheet" media="all" href="<?php echo $this->themeUrl() ?>css/annotrax_all.css" />
	<script src="<?php echo $this->themeUrl() ?>js/lib/jquery-ui/jquery-1.4.2.js"></script>
	<script src="<?php echo $this->themeUrl() ?>js/annotrax_all_min.js" type="text/javascript"></script>
</head>
<body>
	<div id="center">
		<div class="section">
			<div id="logo">
				<a href="/">
					<img src="<?php echo $this->themeUrl() ?>css/annotrax_logo.jpg" />
				</a>
			</div>
			<div id="navigation">
				<ul>
					<li><a class="navItem" href="/">Home</a></li>
					<?php $pages   = new Default_Model_Page(); // MOVE TO VIEW HELPER! ?>
					<?php foreach( $pages->fetchAll() as $page ): ?>
						<li><a class="navItem" href="/pages/<?php echo $page->id ?>"><?php echo $page->title ?></a></li>
					<?php endforeach; ?>
				</ul>
			</div>
		</div>
		<div class="section">
			<div id="search">
				<?php echo new Default_Form_SimpleSearch() ?>
			</div>
			<div id="user-block">
				<?php if( Zend_Auth::getInstance()->hasIdentity() ): ?>
					<?php
						echo $this->translate("Hi %1\$s,", $this->User() );
					?>
					<a href="/user/profile"><?php echo $this->translate("view your profile") ?></a> |
					<a href="/user/logout/"><?php echo $this->translate("logout") ?></a>
				<?php else: ?>
					<a href="/user/login">
						<?php echo $this->translate("Log in to participate!"); ?>
					</a>
				<?php endif; ?>
			</div>
		</div>
		<?php echo $this->layout()->content ?>
	</div>
	<div id="footer">

	</div>
<script>
/**
 * disable playback by default for development purpose
 */
video = document.getElementsByTagName('video');
for( var i = 0; i < video.length; i++ ){
	video[i].pause();
}
</script>
</body>
</html>
